this._window = new Gtk.ApplicationWindow({ application: app,
window_position: Gtk.WindowPosition.CENTER });
- this._window.set_size_request(800, 500);
+ this._window.set_default_size(800, 500);
this._titlebar = new Gtk.HeaderBar({ show_close_button: true,
- title: _("GNOME Shell Extensions") });
+ title: _("Shell Extensions") });
this._window.set_titlebar(this._titlebar);
let killSwitch = new Gtk.Switch({ valign: Gtk.Align.CENTER });
Gio.SettingsBindFlags.BIND_DEFAULT |
Gio.SettingsBindFlags.INVERT_BOOLEAN);
- let scroll = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER,
- shadow_type: Gtk.ShadowType.IN,
- halign: Gtk.Align.CENTER,
- propagate_natural_width: true,
- margin: 18 });
+ let scroll = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER });
this._window.add(scroll);
this._extensionSelector = new Gtk.ListBox({ selection_mode: Gtk.SelectionMode.NONE });
}
});
+const DescriptionLabel = new Lang.Class({
+ Name: 'DescriptionLabel',
+ Extends: Gtk.Label,
+
+ vfunc_get_preferred_height_for_width: function(width) {
+ // Hack: Request the maximum height allowed by the line limit
+ if (this.lines > 0)
+ return this.parent(0);
+ return this.parent(width);
+ }
+});
+
const ExtensionRow = new Lang.Class({
Name: 'ExtensionRow',
Extends: Gtk.ListBoxRow,
let extension = ExtensionUtils.extensions[this.uuid];
let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
- hexpand: true, margin: 12, spacing: 6 });
+ hexpand: true, margin_end: 24, spacing: 24,
+ margin: 12 });
this.add(hbox);
let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
vbox.add(label);
let desc = extension.metadata.description.split('\n')[0];
- label = new Gtk.Label({ label: desc,
- ellipsize: Pango.EllipsizeMode.END,
- halign: Gtk.Align.START });
+ label = new DescriptionLabel({ label: desc, wrap: true, lines: 2,
+ ellipsize: Pango.EllipsizeMode.END,
+ xalign: 0, yalign: 0 });
vbox.add(label);
let button = new Gtk.Button({ valign: Gtk.Align.CENTER,